<?php
namespace App\Utils\Cache;

/**
 * Redis缓存驱动
 * 要求安装phpredis扩展
 */
class RedisKey{
    //table
    const DB_TABLE_COLUMNS = "supplychain:db:table:{table}:columns";

    //用户登录的token发行时间
    const LOGIN_TOKEN_IAT = "supplychain:admin:login:token:iat:{uid}";

    //pos登录编码
    const POS_LOGIN_CODE = "supplychain:admin:login:code:{code}";

    //MENU
    //可见的菜单
    const MENU_VIEW_LIST = "supplychain:admin:menu:view:list";

    //权限菜单uri(拆开的uri=>menu_id)
    const MENU_URI_MENU_ID_DICT = "supplychain:admin:menu:uri:{uri}";


    //角色权限信息
    const ROLE_MENU_ID_LIST_RELATION = "supplychain:role:menu-id-list-relation:{role_id}";


    //管理员权限信息
    const ADMIN_MENU_ID_LIST_RELATION = "supplychain:admin:menu-id-list-relation:{admin_id}";


    //单据类型
    const RECEIPT_TYPE = "supplychain:admin:receipt:receipt_type:{receipt_type}";

    const RECEIPT_TYPE_INFO = "supplychain:admin:receipt:receipt_type_info:{receipt_type}";

    //超级管理员信息
    const SUPER_INFO = "supplychain:super:{admin_id}";

    //集团管理员信息
    const ADMIN_INFO = "supplychain:admin:{admin_id}";

    // 集团支付token
    const TENANT_PAY_TOKEN = "supplychain:pay:token:tenant:{tenant_id}";

    // 集团信息
    const TENANT_INFO = "supplychain:tenant:info:{tenant_id}";

    // 集团常用热数据hash
    const TENANT_REPOSITORY_INFO = "supplychain:tenant:repository:{tenant_id}";

    //供应链参数信息
    const SUPPLYCHAIN_CONFIG_FIELD_LIST = "supplychain:config:field_list:all";

    //供应链参数信息
    const SUPPLYCHAIN_CONFIG = "supplychain:config:tab:{tab_value}:info:tenant:{tanant_id}";

    //供应链参数锁拥有者
    const SUPPLYCHAIN_CONFIG_TENANT_LOCK = "supplychain:config:lock:tenant:{tanant_id}";


    //组织信息
    const ORGANIZE_INFO = "supplychain:admin:organize:{organize_id}";

    // 统计BOM销售扣减队列数量
    const BOM_DISHES_SALE_NUM = "supplychain:admin:bom:sale:num";

    //采购订单code最新编码
    const PURCHASE_CODE_UP = "supplychain:purchase:code:{prefix_date}";

    //集团当前会计期
    const TENANT_FISCAL_PERIOD = "supplychain:tenant:fiscalperiod:{tenant_id}";

    // 采购退货订单生成
    const PURCHASE_RETURN_ORDER = "supplychain:admin:purchase:return:purchase:{tenant_id}";

    // 统配退货订单生成
    const PURCHASE_RETURN_UNIFIED_ORDER = "supplychain:admin:purchase:return:unified:{tenant_id}";

    // 供应商/自采退货退货订单生成
    const PURCHASE_RETURN_PICK_ORDER = "supplychain:admin:purchase:return:pick:{tenant_id}";

    // 配送中心充值
    const DISTRIBUTION_CENTER_RECHARGE = "supplychain:admin:distribution:recharge:{id}";
    const SHOP_RECHARGE_ORDER_NOTIFY =  "supplychain:admin:shop:recharge:{id}";

    //组织的配送中心、销售中心
    const ORGANIZE_CENTER = "supplychain:organize:center:{organize_id}";

    //集团常用特殊组织
    const TENANT_COMMON_ORG = "supplychain:tenant:common_organize:{tenant_id}";


    //消息队列
    //设置发布时间消费者
    const TO_PUBLISH_MESSAGE = "supplychain:consumer:to_publish_message:{id}";

    //品智门店消费者
    const THIRD_POS_PINZHI_SHOP_MESSAGE_PAGE_SET = "supplychain:consumer:third:pos:pinzhi:tenant:{tenantId}:shop_message:page:set";
    const THIRD_POS_PINZHI_SHOP_MESSAGE = "supplychain:consumer:third:pos:pinzhi:tenant:{tenantId}:shop_message:{md5}";


    //品智菜品消费者
    const THIRD_POS_PINZHI_DISH_MESSAGE = "supplychain:consumer:third:pos:pinzhi:tenant:{tenantId}:dish_message:{md5}";
    const THIRD_POS_PINZHI_DISH_MESSAGE_PAGE_SET = "supplychain:consumer:third:pos:pinzhi:tenant:{tenantId}:dish_message:page:set";

    //品智菜品做法列表
    const THIRD_POS_PINZHI_DISH_WAY_LIST = "supplychain:consumer:third:pos:pinzhi:tenant:{tenantId}:dish_way_list";

    //品智菜品配料消费者
    const THIRD_POS_PINZHI_DISH_INGREDIENT_MESSAGE = "supplychain:consumer:third:pos:pinzhi:tenant:{tenantId}:dish_ingredient_message:{md5}";
    const THIRD_POS_PINZHI_DISH_INGREDIENT_MESSAGE_PAGE_SET = "supplychain:consumer:third:pos:pinzhi:tenant:{tenantId}:dish_ingredient_message:page:set";


    //品智订单消费者
    const THIRD_POS_PINZHI_ORDER_MESSAGE = "supplychain:consumer:third:pos:pinzhi:tenant:{tenantId}:shop:{shopId}:order_message:{md5}";
    const THIRD_POS_PINZHI_ORDER_MESSAGE_PAGE_SET = "supplychain:consumer:third:pos:pinzhi:tenant:{tenantId}:shop:{shopId}:order_message:page:set";
    const THIRD_POS_PINZHI_ORDER_MESSAGE_NUM = "supplychain:consumer:third:pos:pinzhi:tenant:{tenantId}:shop:{shopId}:order_message:nums";

    //品智订单统计(销售)消息
    const THIRD_POS_PINZHI_SALE_MESSAGE = "supplychain:consumer:third:pos:pinzhi:tenant:{tenantId}:shop:{shopId}:sale_message";

    //判断是否可以出库
    const THIRD_POS_PINZHI_IS_SALE_OUT = "supplychain:consumer:third:pos:pinzhi:tenant:{tenantId}:is_sale_out:{shopId}";

    //品智订单出库消息
    const THIRD_POS_PINZHI_SALE_OUT_MESSAGE = "supplychain:consumer:third:pos:pinzhi:tenant:{tenantId}:sale_out_message:{shopId}";


    // 统计BOM销售执行的锁
    const BOM_DISHES_SALE_LOCK = "supplychain:consumer:bom:sale:lock:{id}";

    // JSX菜品拉取队列 菜品门店关联队列
    const THIRD_POS_JSX_DISHES_SYNC_RUN_LOCK = "supplychain:run:pos:jsx:dishes_sync_lock:{id}";
    const THIRD_POS_JSX_DISHES_SYNC_LOCK = "supplychain:consumer:pos:jsx:dishes_sync_lock:{id}";
    const THIRD_POS_JSX_DISHES_SYNC_NUM = "supplychain:consumer:pos:jsx:dishes_sync_num:{id}";
    const THIRD_POS_JSX_DISHES_RELATION_SHOP_LOCK = "supplychain:consumer:pos:jsx:dishes_relation_shop_lock:{id}";

    const PURCHSE_SHARECODE = "supplychain:puchase_sharecode:{id}";
    // 对外接口队列
    const THIRD_POS_OPEN_DISHES_SALE_LOCK = "supplychain:consumer:pos:open:dishes_sale_lock:{id}";



}